package com.jiangyg.mall.search.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.List;

/**
 * 类描述：查询结果VO
 *
 * @author jiangyg
 * @date 2021-12-11
 */
@Data
@NoArgsConstructor
@EqualsAndHashCode
public class SkuSearchResultVO implements Serializable {

    private static final long serialVersionUID = 5038375607655633534L;

    /**
     * 页码
     */
    private Integer current = 1;

    /**
     * 总条数
     */
    private Long total;

    /**
     * 总页数
     */
    private Integer pages;

    /**
     * 商品信息
     */
    private List<Sku> skus;

    /**
     * 商品涉及所有属性
     */
    private List<Attr> attrs;

    /**
     * 商品涉及到的所有品牌信息
     */
    private List<Brand> brands;

    /**
     * 当前商品涉及到的所有分类信息
     */
    private List<Category> categorys;

    @Data
    @NoArgsConstructor
    @EqualsAndHashCode
    public static class Sku implements Serializable {

        private static final long serialVersionUID = -6481500122630160676L;

        /**
         * skuId
         */
        private String id;

        /**
         * 标题
         */
        private String title;

        /**
         * 副标题
         */
        private String subtitle;

        /**
         * 价格
         */
        private double price;

        /**
         * 图片集
         */
        private List<Image> images;

    }

    @Data
    @NoArgsConstructor
    @EqualsAndHashCode
    @AllArgsConstructor
    public static class Image implements Serializable {

        private static final long serialVersionUID = -7135569865763494794L;

        /**
         * 图片地址
         */
        private String url;

        /**
         * 是否默认
         */
        private boolean isDefault;

    }

    @Data
    @NoArgsConstructor
    @EqualsAndHashCode
    public static class Attr implements Serializable {

        private static final long serialVersionUID = 2747884842394853726L;

        /**
         * 属性ID
         */
        private String id;

        /**
         * 属性名
         */
        private String name;

        /**
         * 属性值集合
         */
        private List<String> values;

    }

    @Data
    @NoArgsConstructor
    @EqualsAndHashCode
    public static class Brand implements Serializable {

        private static final long serialVersionUID = 5451167500437992259L;

        /**
         * 品牌ID
         */
        private String id;

        /**
         * 品牌名称
         */
        private String name;

        /**
         * 品牌logo
         */
        private String logo;

    }

    @Data
    @NoArgsConstructor
    @EqualsAndHashCode
    public static class Category implements Serializable {

        private static final long serialVersionUID = -2713798402556789900L;

        /**
         * 品牌ID
         */
        private String id;

        /**
         * 品牌名称
         */
        private String name;

    }

}
